<option value="0">All (<%=state_count['all']%>)</option>
<%
 [['Inbox','inbox'],
 ['Next Action','next'],
 ['Waiting','waiting'],
 ['Sometime/Maybe','maybe'],
 ['Reference','ref']].each {|text,state| -%>
<option id="state<%=state%>" value="<%=state%>"<%if session[:selected_state]==state then%> selected<%end%>><%= text %> (<%=state_count[state]%>)</option>
<% } -%>

